import request from '@/config/axios'
import type { MiniTicket } from './types'

export const getMiniTicketsListApi = (params: any): Promise<IResponse<IResData<MiniTicket>>> => {
  return request.get({ url: '/mini-tickets', params })
}

// export const createMiniTicketsApi = (data: Partial<MiniTicket>): Promise<IResponse> => {
//   return request.post({ url: '/mini-tickets', data })
// }

export const updateMiniTicketsApi = (id: string, data: Partial<MiniTicket>): Promise<IResponse> => {
  return request.put({ url: `/mini-tickets/id/${id}`, data })
}

export const resolveMiniTicketsApi = (
  id: string,
  data: Partial<MiniTicket>
): Promise<IResponse> => {
  return request.put({ url: `/mini-tickets/resolve/id/${id}`, data })
}

export const getMiniTicketsDetailApi = (id: string): Promise<IResponse<MiniTicket>> => {
  return request.get({ url: `/mini-tickets/id/${id}` })
}

// export const delMiniTicketsListApi = (ids: string[] | number[]): Promise<IResponse> => {
//   return request.delete({ url: `/mini-tickets/id/${ids[0]}` })
// }
